package com.itcanteen.medical.docker.util;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import com.aliyun.oss.model.PutObjectRequest;

import java.io.InputStream;


public class OSSUploadUtils {


   public static void uploadFile(String bucket,InputStream inputStream,String fileName,String endpoint,String accessKeyId,String accessKeySecret){

       OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);

       PutObjectRequest putObjectRequest = new PutObjectRequest(bucket, fileName, inputStream);

       ossClient.putObject(putObjectRequest);

       ossClient.shutdown();

   }

}
